package com.camel.base.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.camel.core.enums.BaseEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author Administrator
 */

@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PstNumberType implements BaseEnum {
    /**
     * 外呼号码类型
     */
    NO_APPLY(0, "未申请"), APPLYED(1, "已申请"), PASSED(3, "已完成"), REFUSE(3, "拒绝");

    @EnumValue
    private Integer value;

    private String desc;

    PstNumberType(Integer code, String desc) {
        this.value = code;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public BaseEnum getEnumByValue(Integer value) {
        for (PstNumberType types : PstNumberType.values()) {
            if(types.getValue().equals(value)) {
                return types;
            }
        }
        return null;
    }
}
